home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2004 #6 / Amiga Plus CD - 2004 - No. 06.iso / AmigaPlus / Begleitmaterial / 50Tools / Grafik / PerfectPaint / rexx / Anim / Dissolve / Box < prev    next >
Text File  |  2001-10-01  |  2KB  |  110 lines

  1. /* Dissolve Circle
  2. 110
  3. */
  4.  
  5.     call addlib("rexxmathlib.library", 5, -30, 0)
  6.  
  7.     options results
  8.  
  9.     parse ARG Port Opt1 Opt2 Opt3 s0 t0 s1 t1 b
  10.     
  11.     ADDRESS value Port
  12.  
  13.     pp_GetWidth
  14.     w=result
  15.     pp_GetHeight
  16.     h=result
  17.     pp_GetDepth
  18.     D=result
  19.  
  20.     pp_GetCurrentBuffer
  21.     CBf=result
  22.     pp_GetCurrentBrush
  23.     CB=result
  24.  
  25.     pp_FindEmptyBrush
  26.     Brush=result
  27.     if Brush=-1 then DO
  28.         pp_Warn "can't*find*empty|Brush."
  29.         EXIT        
  30.     END
  31.     pp_SetBrush Brush        
  32.  
  33.     pp_FindEmptyBuffer
  34.     Bf=result
  35.     if Bf=-1 then DO
  36.         pp_Warn "can't*find*empty|Buffer."
  37.         EXIT        
  38.     END
  39.     pp_SetBuffer Bf
  40.  
  41.     pp_New w h 24
  42.     pp_SpareOnOff
  43.  
  44.     /* Draw your Mask */
  45.         pp_ClearRange 0
  46.         IF Opt2=0 then DO
  47.             pp_setRange 0 0 0 0 0
  48.             pp_setRange 0 19 255 255 255
  49.             pp_Gradient 0 5 w/2 h/2
  50.         END
  51.         IF Opt2=1 then DO
  52.             pp_setRange 0 19 0 0 0
  53.             pp_setRange 0 0 255 255 255
  54.             pp_Gradient 0 5 w/2 h/2
  55.         END
  56.  
  57.         pp_EffectOn
  58.         pp_ComposeReqOff
  59.         pp_BoxF 0 0 w-1 h-1
  60.         pp_ComposeReqOn
  61.         pp_EffectOff
  62.  
  63.     /*    End    */
  64.     
  65.     pp_SparetoStencil
  66.     pp_SSave "ram:DisSten"
  67.     pp_ClearCurrentBuffer
  68.     pp_SetBuffer CBf
  69.  
  70.     pp_SLoad "ram:DisSten"
  71.     ADDRESS COMMAND
  72.     'delete >nil: ram:DisSten'
  73.     ADDRESS value Port
  74.  
  75.     pp_GotoFrame s1
  76.     pp_PicttoSpare
  77.     pp_GotoFrame s0            
  78.     pp_Pickbrush 0 0 W H 1
  79.     
  80.     step=(s1-s0)
  81.     Step_f=255/Step
  82.  
  83.     DO i=s0 to s1
  84.         IF t1=1 then DO
  85.             pp_GotoFrame (s1+i-s0)
  86.             pp_PicttoSpare
  87.         END
  88.  
  89.         pp_GotoFrame i
  90.  
  91.         IF t0=0 then DO
  92.             pp_plot W/2 H/2
  93.         END
  94.  
  95.         f=Step_f*(i-s0)
  96.         IF Opt1=0 then DO
  97.             pp_Dissolve f 255            
  98.         END
  99.         ELSE DO
  100.             pp_Dissolve f f
  101.         END
  102.         pp_Refresh
  103.     END
  104.  
  105.         pp_Gotoframe s0
  106.         pp_FreeBrush
  107.         pp_SetBrush CB
  108.  
  109.     EXIT
  110.